home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / filectrl.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  13.3 KB  |  398 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'FileCtrl.pas' rev: 3.00
  6.  
  7. #ifndef FileCtrlHPP
  8. #define FileCtrlHPP
  9. #include <Buttons.hpp>
  10. #include <StdCtrls.hpp>
  11. #include <Menus.hpp>
  12. #include <Forms.hpp>
  13. #include <Graphics.hpp>
  14. #include <Controls.hpp>
  15. #include <Classes.hpp>
  16. #include <SysUtils.hpp>
  17. #include <Messages.hpp>
  18. #include <Windows.hpp>
  19. #include <SysInit.hpp>
  20. #include <System.hpp>
  21.  
  22. //-- user supplied -----------------------------------------------------------
  23.  
  24. namespace Filectrl
  25. {
  26. //-- type declarations -------------------------------------------------------
  27. enum TFileAttr { ftReadOnly, ftHidden, ftSystem, ftVolumeID, ftDirectory, ftArchive, ftNormal };
  28.  
  29. typedef Set<TFileAttr, ftReadOnly, ftNormal>  TFileType;
  30.  
  31. enum TDriveType { dtUnknown, dtNoDrive, dtFloppy, dtFixed, dtNetwork, dtCDROM, dtRAM };
  32.  
  33. class DELPHICLASS TFileListBox;
  34. class DELPHICLASS TDirectoryListBox;
  35. class DELPHICLASS TDriveComboBox;
  36. enum TTextCase { tcLowerCase, tcUpperCase };
  37.  
  38. class PASCALIMPLEMENTATION TDriveComboBox : public Stdctrls::TCustomComboBox 
  39. {
  40.     typedef Stdctrls::TCustomComboBox inherited;
  41.     
  42. private:
  43.     TDirectoryListBox* FDirList;
  44.     char FDrive;
  45.     TTextCase FTextCase;
  46.     void __fastcall SetDirListBox(TDirectoryListBox* Value);
  47.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  48.     void __fastcall SetDrive(char NewDrive);
  49.     void __fastcall SetTextCase(TTextCase NewTextCase);
  50.     void __fastcall ReadBitmaps(void);
  51.     void __fastcall ResetItemHeight(void);
  52.     
  53. protected:
  54.     Graphics::TBitmap* FloppyBMP;
  55.     Graphics::TBitmap* FixedBMP;
  56.     Graphics::TBitmap* NetworkBMP;
  57.     Graphics::TBitmap* CDROMBMP;
  58.     Graphics::TBitmap* RAMBMP;
  59.     virtual void __fastcall CreateWnd(void);
  60.     virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect, Stdctrls::TOwnerDrawState State
  61.         );
  62.     DYNAMIC void __fastcall Click(void);
  63.     virtual void __fastcall BuildList(void);
  64.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  65.         );
  66.     
  67. public:
  68.     __fastcall virtual TDriveComboBox(Classes::TComponent* AOwner);
  69.     __fastcall virtual ~TDriveComboBox(void);
  70.     __property Text ;
  71.     __property char Drive = {read=FDrive, write=SetDrive, nodefault};
  72.     
  73. __published:
  74.     __property Color ;
  75.     __property Ctl3D ;
  76.     __property TDirectoryListBox* DirList = {read=FDirList, write=SetDirListBox};
  77.     __property DragMode ;
  78.     __property DragCursor ;
  79.     __property Enabled ;
  80.     __property Font ;
  81.     __property ImeMode ;
  82.     __property ImeName ;
  83.     __property ParentColor ;
  84.     __property ParentCtl3D ;
  85.     __property ParentFont ;
  86.     __property ParentShowHint ;
  87.     __property PopupMenu ;
  88.     __property ShowHint ;
  89.     __property TabOrder ;
  90.     __property TabStop ;
  91.     __property TTextCase TextCase = {read=FTextCase, write=SetTextCase, default=0};
  92.     __property Visible ;
  93.     __property OnChange ;
  94.     __property OnClick ;
  95.     __property OnDblClick ;
  96.     __property OnDragDrop ;
  97.     __property OnDragOver ;
  98.     __property OnDropDown ;
  99.     __property OnEndDrag ;
  100.     __property OnEnter ;
  101.     __property OnExit ;
  102.     __property OnKeyDown ;
  103.     __property OnKeyPress ;
  104.     __property OnKeyUp ;
  105.     __property OnStartDrag ;
  106. public:
  107.     /* TWinControl.CreateParented */ __fastcall TDriveComboBox(HWND ParentWindow) : Stdctrls::TCustomComboBox(
  108.         ParentWindow) { }
  109.     
  110. };
  111.  
  112. class PASCALIMPLEMENTATION TDirectoryListBox : public Stdctrls::TCustomListBox 
  113. {
  114.     typedef Stdctrls::TCustomListBox inherited;
  115.     
  116. private:
  117.     TFileListBox* FFileList;
  118.     TDriveComboBox* FDriveCombo;
  119.     Stdctrls::TLabel* FDirLabel;
  120.     bool FInSetDir;
  121.     bool FPreserveCase;
  122.     bool FCaseSensitive;
  123.     char __fastcall GetDrive(void);
  124.     void __fastcall SetFileListBox(TFileListBox* Value);
  125.     void __fastcall SetDirLabel(Stdctrls::TLabel* Value);
  126.     void __fastcall SetDirLabelCaption(void);
  127.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  128.     void __fastcall SetDrive(char Value);
  129.     void __fastcall DriveChange(char NewDrive);
  130.     void __fastcall SetDir(const System::AnsiString NewDirectory);
  131.     virtual void __fastcall SetDirectory(const System::AnsiString NewDirectory);
  132.     void __fastcall ResetItemHeight(void);
  133.     
  134. protected:
  135.     Graphics::TBitmap* ClosedBMP;
  136.     Graphics::TBitmap* OpenedBMP;
  137.     Graphics::TBitmap* CurrentBMP;
  138.     System::AnsiString FDirectory;
  139.     Classes::TNotifyEvent FOnChange;
  140.     virtual void __fastcall Change(void);
  141.     DYNAMIC void __fastcall DblClick(void);
  142.     virtual void __fastcall ReadBitmaps(void);
  143.     virtual void __fastcall CreateWnd(void);
  144.     virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect, Stdctrls::TOwnerDrawState State
  145.         );
  146.     int __fastcall ReadDirectoryNames(const System::AnsiString ParentDirectory, Classes::TStringList* DirectoryList
  147.         );
  148.     virtual void __fastcall BuildList(void);
  149.     DYNAMIC void __fastcall KeyPress(char &Key);
  150.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  151.         );
  152.     
  153. public:
  154.     __fastcall virtual TDirectoryListBox(Classes::TComponent* AOwner);
  155.     __fastcall virtual ~TDirectoryListBox(void);
  156.     System::AnsiString __fastcall DisplayCase(const System::AnsiString S);
  157.     int __fastcall FileCompareText(const System::AnsiString A, const System::AnsiString B);
  158.     System::AnsiString __fastcall GetItemPath(int Index);
  159.     void __fastcall OpenCurrent(void);
  160.     HIDESBASE void __fastcall Update(void);
  161.     __property char Drive = {read=GetDrive, write=SetDrive, nodefault};
  162.     __property System::AnsiString Directory = {read=FDirectory, write=SetDirectory};
  163.     __property bool PreserveCase = {read=FPreserveCase, nodefault};
  164.     __property bool CaseSensitive = {read=FCaseSensitive, nodefault};
  165.     
  166. __published:
  167.     __property Align ;
  168.     __property Color ;
  169.     __property Columns ;
  170.     __property Ctl3D ;
  171.     __property Stdctrls::TLabel* DirLabel = {read=FDirLabel, write=SetDirLabel};
  172.     __property DragCursor ;
  173.     __property DragMode ;
  174.     __property Enabled ;
  175.     __property TFileListBox* FileList = {read=FFileList, write=SetFileListBox};
  176.     __property Font ;
  177.     __property ImeMode ;
  178.     __property ImeName ;
  179.     __property IntegralHeight ;
  180.     __property ItemHeight ;
  181.     __property ParentColor ;
  182.     __property ParentCtl3D ;
  183.     __property ParentFont ;
  184.     __property ParentShowHint ;
  185.     __property PopupMenu ;
  186.     __property ShowHint ;
  187.     __property TabOrder ;
  188.     __property TabStop ;
  189.     __property Visible ;
  190.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  191.     __property OnClick ;
  192.     __property OnDblClick ;
  193.     __property OnDragDrop ;
  194.     __property OnDragOver ;
  195.     __property OnEndDrag ;
  196.     __property OnEnter ;
  197.     __property OnExit ;
  198.     __property OnKeyDown ;
  199.     __property OnKeyPress ;
  200.     __property OnKeyUp ;
  201.     __property OnMouseDown ;
  202.     __property OnMouseMove ;
  203.     __property OnMouseUp ;
  204.     __property OnStartDrag ;
  205. public:
  206.     /* TWinControl.CreateParented */ __fastcall TDirectoryListBox(HWND ParentWindow) : Stdctrls::TCustomListBox(
  207.         ParentWindow) { }
  208.     
  209. };
  210.  
  211. class DELPHICLASS TFilterComboBox;
  212. class PASCALIMPLEMENTATION TFilterComboBox : public Stdctrls::TCustomComboBox 
  213. {
  214.     typedef Stdctrls::TCustomComboBox inherited;
  215.     
  216. private:
  217.     System::AnsiString FFilter;
  218.     TFileListBox* FFileList;
  219.     Classes::TStringList* MaskList;
  220.     bool __fastcall IsFilterStored(void);
  221.     System::AnsiString __fastcall GetMask(void);
  222.     void __fastcall SetFilter(const System::AnsiString NewFilter);
  223.     void __fastcall SetFileListBox(TFileListBox* Value);
  224.     
  225. protected:
  226.     DYNAMIC void __fastcall Change(void);
  227.     virtual void __fastcall CreateWnd(void);
  228.     DYNAMIC void __fastcall Click(void);
  229.     void __fastcall BuildList(void);
  230.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  231.         );
  232.     
  233. public:
  234.     __fastcall virtual TFilterComboBox(Classes::TComponent* AOwner);
  235.     __fastcall virtual ~TFilterComboBox(void);
  236.     __property System::AnsiString Mask = {read=GetMask};
  237.     __property Text ;
  238.     
  239. __published:
  240.     __property Color ;
  241.     __property Ctl3D ;
  242.     __property DragMode ;
  243.     __property DragCursor ;
  244.     __property Enabled ;
  245.     __property TFileListBox* FileList = {read=FFileList, write=SetFileListBox};
  246.     __property System::AnsiString Filter = {read=FFilter, write=SetFilter, stored=IsFilterStored};
  247.     __property Font ;
  248.     __property ImeName ;
  249.     __property ImeMode ;
  250.     __property ParentColor ;
  251.     __property ParentCtl3D ;
  252.     __property ParentFont ;
  253.     __property ParentShowHint ;
  254.     __property PopupMenu ;
  255.     __property ShowHint ;
  256.     __property TabOrder ;
  257.     __property TabStop ;
  258.     __property Visible ;
  259.     __property OnChange ;
  260.     __property OnClick ;
  261.     __property OnDblClick ;
  262.     __property OnDragDrop ;
  263.     __property OnDragOver ;
  264.     __property OnDropDown ;
  265.     __property OnEndDrag ;
  266.     __property OnEnter ;
  267.     __property OnExit ;
  268.     __property OnKeyDown ;
  269.     __property OnKeyPress ;
  270.     __property OnKeyUp ;
  271.     __property OnStartDrag ;
  272. public:
  273.     /* TWinControl.CreateParented */ __fastcall TFilterComboBox(HWND ParentWindow) : Stdctrls::TCustomComboBox(
  274.         ParentWindow) { }
  275.     
  276. };
  277.  
  278. class PASCALIMPLEMENTATION TFileListBox : public Stdctrls::TCustomListBox 
  279. {
  280.     typedef Stdctrls::TCustomListBox inherited;
  281.     
  282. private:
  283.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  284.     char __fastcall GetDrive(void);
  285.     System::AnsiString __fastcall GetFileName(void);
  286.     bool __fastcall IsMaskStored(void);
  287.     void __fastcall SetDrive(char Value);
  288.     void __fastcall SetFileEdit(Stdctrls::TEdit* Value);
  289.     void __fastcall SetDirectory(const System::AnsiString NewDirectory);
  290.     void __fastcall SetFileType(TFileType NewFileType);
  291.     void __fastcall SetMask(const System::AnsiString NewMask);
  292.     void __fastcall SetFileName(const System::AnsiString NewFile);
  293.     void __fastcall SetShowGlyphs(bool Value);
  294.     void __fastcall ResetItemHeight(void);
  295.     
  296. protected:
  297.     System::AnsiString FDirectory;
  298.     System::AnsiString FMask;
  299.     TFileType FFileType;
  300.     Stdctrls::TEdit* FFileEdit;
  301.     TDirectoryListBox* FDirList;
  302.     TFilterComboBox* FFilterCombo;
  303.     Graphics::TBitmap* ExeBMP;
  304.     Graphics::TBitmap* DirBMP;
  305.     Graphics::TBitmap* UnknownBMP;
  306.     Classes::TNotifyEvent FOnChange;
  307.     int FLastSel;
  308.     bool FShowGlyphs;
  309.     virtual void __fastcall CreateWnd(void);
  310.     virtual void __fastcall ReadBitmaps(void);
  311.     DYNAMIC void __fastcall Click(void);
  312.     virtual void __fastcall Change(void);
  313.     virtual void __fastcall ReadFileNames(void);
  314.     virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect, Stdctrls::TOwnerDrawState State
  315.         );
  316.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  317.         );
  318.     virtual System::AnsiString __fastcall GetFilePath(void);
  319.     
  320. public:
  321.     __fastcall virtual TFileListBox(Classes::TComponent* AOwner);
  322.     __fastcall virtual ~TFileListBox(void);
  323.     HIDESBASE void __fastcall Update(void);
  324.     virtual void __fastcall ApplyFilePath(const System::AnsiString EditText);
  325.     __property char Drive = {read=GetDrive, write=SetDrive, nodefault};
  326.     __property System::AnsiString Directory = {read=FDirectory, write=ApplyFilePath};
  327.     __property System::AnsiString FileName = {read=GetFilePath, write=ApplyFilePath};
  328.     
  329. __published:
  330.     __property Align ;
  331.     __property Color ;
  332.     __property Ctl3D ;
  333.     __property DragCursor ;
  334.     __property DragMode ;
  335.     __property Enabled ;
  336.     __property ExtendedSelect ;
  337.     __property Stdctrls::TEdit* FileEdit = {read=FFileEdit, write=SetFileEdit};
  338.     __property TFileType FileType = {read=FFileType, write=SetFileType, default=64};
  339.     __property Font ;
  340.     __property ImeMode ;
  341.     __property ImeName ;
  342.     __property IntegralHeight ;
  343.     __property ItemHeight ;
  344.     __property System::AnsiString Mask = {read=FMask, write=SetMask, stored=IsMaskStored};
  345.     __property MultiSelect ;
  346.     __property ParentColor ;
  347.     __property ParentCtl3D ;
  348.     __property ParentFont ;
  349.     __property ParentShowHint ;
  350.     __property PopupMenu ;
  351.     __property bool ShowGlyphs = {read=FShowGlyphs, write=SetShowGlyphs, default=0};
  352.     __property ShowHint ;
  353.     __property TabOrder ;
  354.     __property TabStop ;
  355.     __property Visible ;
  356.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  357.     __property OnClick ;
  358.     __property OnDblClick ;
  359.     __property OnDragDrop ;
  360.     __property OnDragOver ;
  361.     __property OnEndDrag ;
  362.     __property OnEnter ;
  363.     __property OnExit ;
  364.     __property OnKeyDown ;
  365.     __property OnKeyPress ;
  366.     __property OnKeyUp ;
  367.     __property OnMouseDown ;
  368.     __property OnMouseMove ;
  369.     __property OnMouseUp ;
  370.     __property OnStartDrag ;
  371. public:
  372.     /* TWinControl.CreateParented */ __fastcall TFileListBox(HWND ParentWindow) : Stdctrls::TCustomListBox(
  373.         ParentWindow) { }
  374.     
  375. };
  376.  
  377. enum TSelectDirOpt { sdAllowCreate, sdPerformCreate, sdPrompt };
  378.  
  379. typedef Set<TSelectDirOpt, sdAllowCreate, sdPrompt>  TSelectDirOpts;
  380.  
  381. //-- var, const, procedure ---------------------------------------------------
  382. #define WNTYPE_DRIVE (Byte)(1)
  383. extern PACKAGE System::AnsiString __fastcall MinimizeName(const System::AnsiString Filename, Graphics::TCanvas* 
  384.     Canvas, int MaxLen);
  385. extern PACKAGE void __fastcall ProcessPath(const System::AnsiString EditText, char &Drive, System::AnsiString 
  386.     &DirPart, System::AnsiString &FilePart);
  387. extern PACKAGE bool __fastcall SelectDirectory(System::AnsiString &Directory, TSelectDirOpts Options
  388.     , int HelpCtx);
  389. extern PACKAGE bool __fastcall DirectoryExists(const System::AnsiString Name);
  390. extern PACKAGE void __fastcall ForceDirectories(System::AnsiString Dir);
  391.  
  392. }    /* namespace Filectrl */
  393. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  394. using namespace Filectrl;
  395. #endif
  396. //-- end unit ----------------------------------------------------------------
  397. #endif    // FileCtrl
  398.